﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title>铁路货运装卸信息管理系统</title>
    <script type="text/javascript">
        if (window.parent.window != window) {
            window.top.location.href = "/Login/Index";
        }
    </script>
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <link href="~/Content/css/page/login.css" rel="stylesheet" />
    
    <script type="text/javascript">
        function changeCheckCode()
        {
            //
            $("#img").attr("src", $("#img").attr("src") + 1);

        }


        function afterLogin(data)
        {
            var serverData = data.split(':');
            if (serverData[0]=="ok")
            {
              
                window.location.href = "/Home/NewHomePage";
             //   alert(serverData);
            }
            else
            {
                $("#errorMsg").css("display", "block");
                $("#errorMsg").text(serverData[1]);
                changeCheckCode();
            }
        }


    </script>

  


</head>
<body style="padding: 10px">
   

    <div class="second_body">
     

            <div class="logo"><img src="/Content/images/login/logo.png
                                   " alt=""  width="260px" height="180px"/></div>
            <div class="title-zh">
                @ViewBag.HeadTitle
            </div>

            <div class="message" data-bind="html:message"></div>
            @using (Ajax.BeginForm("UserLogin", "Login", new { },
           new AjaxOptions { HttpMethod = "post", OnSuccess = "afterLogin", LoadingElementId = "div1" }, new { id = "loginForm" }))
            {
                <table border="0" style="width:300px;">
                    <tr>
                        <td align="right">  账号：</td>
                        <td align="left" colspan="2">
                            <input type="text" name="LoginCode" id="LoginCode" class="login" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">  密码：</td>
                        <td align="left" colspan="2">

                            <input type="password" name="LoginPwd" id="LoginPwd" value="123456" class="login" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">  验证码：</td>
                        <td align="left" colspan="2">
                            <input type="text" class="login" id="code" name="vCode" value="1" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">  </td>
                        <td align="left" colspan="2">
                            <img id="img" src="/Login/ShowValidateCode?id=1" style="float: left; height: 24px;" />
                            <div style="float: left; margin-left: 5px; margin-top: 10px;">
                                <a href="javascript:void(0)" onclick="changeCheckCode();return false;">看不清，换一张</a>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="text-align:center">
   
                            <input type="submit" id="btnLogin" value="登录" class="reset_botton" />
                            <input type="checkbox" name="checkMe" value="1" />记住我
                            <span id="errorMsg" style="font-size:14px;color:red;display:none"></span>
                            <div id="div1" style="display:none">正在登录,请稍后。。。</div>
                        </td>
                    </tr>
                </table>
            }
       



    </div>

  
</body>
</html>


